/*
 * @Date: 2023-01-11 23:08:41
 * @LastEditors: Zireael 1193875164@qq.com
 * @LastEditTime: 2023-04-10 15:39:18
 * @FilePath: \A19\frontend\src\route\index.ts
 */
/*
 * @Date: 2023-01-11 23:08:41
 * @LastEditors: Zireael 1193875164@qq.com
 * @LastEditTime: 2023-03-21 15:17:34
 * @FilePath: \A19\frontend\src\route\index.ts
 */
import { RouteRecordRaw, createRouter, createWebHashHistory } from "vue-router";
const routes: RouteRecordRaw[] = [
  {
    path: "/main",
    name: "main",
    component: () => import("@/components/Background.vue"),
    children: [
      {
        path: "demo",
        name: "demo",
        component: () => import("@/components/Demo.vue"),
      },
      {
        path: "menu",
        name: "menu",
        component: () => import("@/components/MainMenu.vue"),
        children: [//MainMenu provide idForSource
          {
            name: "course",
            path: "course",
            component: () => import("@/components/MyCourse.vue"),
          },
          {
            name: "mySource",
            path: "mySource",
            component: () => import("@/components/Lv3_source.vue"),
          },
          {
            path: "",
            redirect: "/main/menu/course",
          },
        ],
      }, //
      {
        path: "course",
        name: "lv2Course",
        component: () => import("@/components/Lv2_Course.vue"),
        children: [//Lv2_Course provide poss
          {
            path: "exam/:courseId",
            name: "exam",
            component: () => import("@/components/Lv3_exam.vue"),
          },
          {
            path: "homework/:courseId",
            name: "homework",
            component: () => import("@/components/Lv3_exam.vue"),
          },
          {
            path: "source/:courseId",
            name: "source",
            component: () => import("@/components/Lv3_source.vue"),
          },
          {
            path:'experiments/:courseId',
            name:'experiments',
            component:() => import('@/components/RunCode/ExpList.vue'),
          },
          {
            path: "discuss/:courseId",
            name: "discuss",
            component: () => import("@/components/Lv3_discuss.vue"),
          },
          
          //judge
          {
            path:"judge/:testId",
            name:"judge",
            component: () => import("@/components/Test/Judge.vue"),
          },
          {
            path:"judgeHomework/:testId",
            name:"judgeHomework",
            component: () => import("@/components/Test/Judge.vue"),
          },
          {
            path:"judgeExp/:expId",
            name:"judgeExp",
            component: () => import("@/components/RunCode/JudgeExp.vue"),
          },
        ],
      },
      {
        path: "login",
        name: "login",
        component: () => import("@/components/login.vue"),
      },
      {
        path: "regist",
        name: "regist",
        component: () => import("@/components/Regist.vue"),
      },
      {
        path: "resetPassword",
        name: "resetPassword",
        component: () => import("@/components/RetrievePassword.vue"),
      },
      {
        path: "",
        redirect: "/login",
      },
    ],
  },
  {
    path: "/file",
    name: "file",
    component: () => import("@/components/FileSystem/File.vue"),
  },
  {
    path: "/testDemo/:testId",
    name: "testDemo",
    component: () => import("@/components/TestDemo.vue"),
  },
  {
    path: "/homeworkDemo/:testId",
    name: "homeworkDemo",
    component: () => import("@/components/TestDemo.vue"),
  },
  {
    path: "/experiment/:expId",
    name: "experiment",
    component: () => import("@/components/RunCode/Experiment.vue"),
  },
  // {
  //   path: "/runCode",
  //   name: "runCode",
  //   component: () => import("@/components/RunCode.vue"),
  // },
  {
    path: "/fileDisplay",
    name: "fileDisplay",
    component: () => import("@/components/FileScreen.vue"),
  },
  {
    path: "/watcher/:testId",
    name: "watcher",
    component: () => import("@/components/Watcher.vue"),
  },
  {
    path: "/liveSend/:courseId",
    name: "liveSend",
    component: () => import("@/components/Class/LiveSend.vue"),
  },
  {
    path: "/liveReceive/:courseId",
    name: "liveReceive",
    component: () => import("@/components/Class/LiveReceive.vue"),
  },
  {
    path: "/createTest/:courseId",
    name: "createTest",
    component: () => import("@/components/Test/CreateTest.vue"),
  },
  {
    path: "/createExp/:courseId",
    name: "createExp",
    component: () => import("@/components/RunCode/CreateExp.vue"),
  },
  {
    path: "/createHomework/:courseId",
    name: "createHomework",
    component: () => import("@/components/Test/CreateTest.vue"),
  },
  {
    path: "/editTest/:testId",
    name: "editTest",
    component: () => import("@/components/Test/EditTest.vue"),
  },
  {
    path: "/editHomework/:testId",
    name: "editHomework",
    component: () => import("@/components/Test/EditTest.vue"),
  },
  {
    path: "/editExp/:expId",
    name: "editExp",
    component: () => import("@/components/RunCode/EditExp.vue"),
  },
  // {
  //   path: "/createHomework",
  //   name: "createHomework",
  //   component: () => import("@/components/Test/CreateTest.vue"),
  // },
  {
    path:"/judgePaper/:testId",
    name:"judgePaper",
    component: () => import("@/components/Test/JudgePaper.vue"),
  },
  {
    path:"/judgeHomeworkPaper/:testId",
    name:"judgeHomeworkPaper",
    component: () => import("@/components/Test/JudgePaper.vue"),
  },
  {
    path:"/judgeExpPaper/:expId",
    name:"judgeExpPaper",
    component: () => import("@/components/RunCode/JudgeExpPaper.vue"),
  },
  {
    path:"/checkTest/:testId",
    name:"checkTest",
    component: () => import("@/components/Test/CheckTest.vue"),
  },
  {
    path:"/checkHomework/:testId",
    name:"checkHomework",
    component: () => import("@/components/Test/CheckTest.vue"),
  },
  {
    path:"/checkExp/:expId",
    name:"checkExp",
    component: () => import("@/components/RunCode/CheckExp.vue"),
  },
  {
    path:"/analysis/:courseId",
    name:"analysis",
    component:() => import("@/components/Charts/Analysis.vue"),
  },
  {
    path:"/mine",
    name:"mine",
    component:() => import("@/components/Mine.vue"),
  },
  {
    path:"/theCourse/:courseId",
    name:"theCourse",
    component:() => import("@/components/TheCourse.vue"),
  },
  {
    path:"/playground",
    name:"playground",
    component:() => import("@/components/RunCode/PlayGround.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    redirect: "/main/login",
  },
];

const router = createRouter({
  routes,
  history: createWebHashHistory(),
});

export default router;
